package qf.wlh.com.oneprisdent;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

public class AllSpeakerContentActivity extends Activity {

    private ImageView imageBack;
    private TextView title;
    private TextView name;
    private TextView text;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_all_speaker_content);
        initView();
    }

    private void initView() {
        imageBack = ((ImageView) findViewById(R.id.image));
        title = ((TextView) findViewById(R.id.title));
        name = ((TextView) findViewById(R.id.name));
        text = ((TextView) findViewById(R.id.nomar_text));
        initData();
        listerner();

    }

    private void initData() {
        Intent intent = getIntent();
        String textTitle=intent.getStringExtra("title");
        String name1 = intent.getStringExtra("name");
        String purecontent1 = intent.getStringExtra("purecontent");
        title.setText(textTitle);
        name.setText(name1);
        text.setText(purecontent1);
    }
    //点击回退到之前的Acativity
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0){
            AllSpeakerContentActivity.this.finish();

            return true;
        }

        return false;
    }
    //点击回退到之前的Acativity
    private void listerner() {
        imageBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //返回到之前的activity
                AllSpeakerContentActivity.this.finish();
            }
        });
    }

}
